package com.songshuai.webapi.jobapi.service.impl;

import com.songshuai.webapi.jobapi.dao.crmbase.HealthCheckDao;
import com.songshuai.webapi.jobapi.model.crmbase.YixueBaseDictionary;
import com.songshuai.webapi.jobapi.service.HealthCheckService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.stereotype.Service;

@Service
public class HealthCheckServiceImpl implements HealthCheckService {

    @Autowired
    private RedisTemplate redisTemplate;

    @Autowired
    private HealthCheckDao healthCheckDao;

    @Override
    public Integer getCheckResult() {
        Integer retData=0;
        YixueBaseDictionary dicInfo=healthCheckDao.getTestSingleDic();
        if(dicInfo!=null)
        {
            retData= dicInfo.getId();
        }
        ValueOperations<String,String> operations=redisTemplate.opsForValue();
        operations.set("Test","1");
        return retData;
    }
}
